<!-- PAGE CONTENT WRAPPER -->
<div class="page-content-wrap">

    <div class="row">
        <div class="col-md-12">

            <div class="panel panel-default tabs">
                <ul class="nav nav-tabs nohref" role="tablist">
                    <li style="min-width: 150px;" ng-class="{'active':'tabInfo' == currentTabId}" ng-click="selectTab('tabInfo')">
                        <a href="javascript:void(0)" role="tab" data-toggle="tab">{{'基本信息' | dyLanguage}}</a>
                    </li>
                    <li style="min-width: 150px;" ng-class="{'active':'tabTopic' == currentTabId}" ng-click="selectTab('tabTopic')">
                        <a href="javascript:void(0)" role="tab" data-toggle="tab">{{'题目信息' | dyLanguage}}</a>
                    </li>
                </ul>
                <div class="panel-body tab-content">
                    <div class="tab-pane" ng-class="{'active':'tabInfo' == currentTabId}" id="tabInfo">
                        <div class="panel panel-default">
                            <div class="panel-body table-responsive">
                                <div class="row">
                                    <div>
                                        <form class="form-horizontal" name="validForm" novalidate>
                                            <div class="panel-default">
                                                <div class="panel-footer" style="text-align: right;">
                                                    <h3 class="panel-title" style="float: left;"><strong>{{'当前页面的操作' | dyLanguage}}</strong></h3>
                                                    <button class="btn btn-info" ng-click="updateContent()"><i class="fa"></i>{{'保存' | dyLanguage}}</button>
                                                </div>
                                                <div class="panel-body panel-dialog">
                                                    <div class="form-group">
                                                        <label class="col-md-3 col-xs-12 control-label">{{'图片' | dyLanguage}}</label>

                                                        <div class="col-md-6 col-xs-12">
                                                            <div class="profile-image">
                                                                <img style="min-height: 50px;min-width: 50px;max-width: 100px;max-height: 100px;" ng-src="{{currentContentQuiz.picture | faceUrl}}" ngf-select ngf-change="uploadPicture($files)"
                                                                     ngf-pattern="'image/*'"
                                                                     ngf-accept="'image/*'"
                                                                     ngf-max-size="20MB" ngf-min-height="100" ngf-resize="{width: 1000, height: 1000}" style="cursor: pointer"/>
                                                            </div>
                                                            <span class="help-block">{{'请上传图片' | dyLanguage}}<i style="cursor: pointer; "><span ng-show="showPictureProgress">({{pictureProgress.value}}%)</span></i></span>
                                                        </div>
                                                    </div>

                                                    <div class="form-group">
                                                        <label class="col-md-3 col-xs-12 control-label">{{'名称' | dyLanguage}}</label>

                                                        <div class="col-md-6 col-xs-12">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                                <input type="text" class="form-control" name="name" ng-model="currentContentQuiz.name" required/>
                                                            </div>
                                                            <span class="help-block" ng-show="(addSCForm.name.$untouched && !addSCForm.$submitted) || addSCForm.name.$valid">{{'请输入名称' | dyLanguage}}</span>
                                                        </div>
                                                    </div>

                                                    <div class="form-group">
                                                        <label class="col-md-3 col-xs-12 control-label">{{'描述' | dyLanguage}}</label>

                                                        <div class="col-md-6 col-xs-12">
                                                            <textarea class="form-control" rows="5" ng-model="currentContentQuiz.remark"></textarea>
                                                            <span class="help-block">{{'请输入描述' | dyLanguage}}</span>
                                                        </div>
                                                    </div>

                                                    <div class="form-group">
                                                        <label class="col-md-3 col-xs-12 control-label">{{'题目数' | dyLanguage}}</label>

                                                        <div class="col-md-6 col-xs-12">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                                <input type="number" class="form-control" name="randomTopicNum" ng-model="currentContentQuiz.randomTopicNum"/>
                                                            </div>
                                                            <span class="help-block">{{'随机抽取的题目数（默认是所有题目）' | dyLanguage}}</span>
                                                        </div>
                                                    </div>

                                                    <div class="form-group">
                                                        <label class="col-md-3 col-xs-12 control-label">{{'及格线' | dyLanguage}}</label>

                                                        <div class="col-md-6 col-xs-12">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                                <input type="number" class="form-control" name="name" ng-model="currentContentQuiz.passingScore"/>
                                                            </div>
                                                            <span class="help-block">{{'请输入及格线，默认是60分' | dyLanguage}}</span>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="panel-footer" style="text-align: right;">
                                                    <h3 class="panel-title" style="float: left;"><strong>{{'当前页面的操作' | dyLanguage}}</strong></h3>
                                                    <button class="btn btn-info" ng-click="updateContent()"><i class="fa"></i>{{'保存' | dyLanguage}}</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="panel-body tab-content">
                    <div class="tab-pane" ng-class="{'active':'tabTopic' == currentTabId}" id="tabTopic">
                        <div class="panel panel-default">
                            <div class="panel-body table-responsive">
                                <div>
                                    <div class="panel-footer" style="text-align: right;">
                                        <h3 class="panel-title" style="float: left;"><strong>{{'当前页面的操作' | dyLanguage}}</strong></h3>
                                        <button class="btn btn-info btn-right" ng-click="addTopic()"><i class="fa fa-plus"></i>{{'新增题目' | dyLanguage}}</button>
                                        <js-xls onread="readWB" onerror="error" class="fileinput btn-info" title="上传微帮格式文件"></js-xls>
                                        <button class="btn btn-info btn-right" ng-click="updateContent()"><i class="fa fa-plus"></i>{{'保存' | dyLanguage}}</button>
                                    </div>
                                    <div class="panel-body table-responsive" ng-repeat="gaugeTopic in currentGaugeTopicGroup.gaugeTopics | orderBy:'itemCode'">
                                        <p>
                                            <label style="margin: 0 10px;">{{gaugeTopic.itemCode}}/{{currentGaugeTopicGroup.gaugeTopics.length}}</label>
                                            <label style="margin: 0 10px;">{{gaugeTopic.content}}</label>
                                            <label style="margin: 0 10px;">({{'类型' | dyLanguage}}:{{gaugeTopic.type | EnumFilter:'GaugeTopicTypeEnum'}})</label>
                                        </p>
                                        <table class="table table-bordered" ng-show="gaugeTopic.type != 'INPUT'">
                                            <thead>
                                            <tr>
                                                <th width="10%">{{'选项' | dyLanguage}}</th>
                                                <th width="10%">{{'分值' | dyLanguage}}</th>
                                                <th>{{'内容' | dyLanguage}}</th>
                                                <th>{{'选项图片' | dyLanguage}}</th>
                                                <th width="10%">{{'下一题' | dyLanguage}}</th>
                                                <th width="10%">{{'操作' | dyLanguage}}</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr ng-repeat="attribute in gaugeTopic.attributes | orderBy:'sort'">
                                                <td>{{attribute.sort}}</td>
                                                <td>{{attribute.score}}</td>
                                                <td>{{attribute.content}}</td>
                                                <td><img ng-src="{{attribute.picture | faceUrl}}" width="100px"></td>
                                                <td>{{attribute.nextItemCode}}</td>
                                                <td>
                                                    <div class="btn-group">
                                                        <a href="javascript:void(0);" data-toggle="dropdown" class="btn btn-primary dropdown-toggle">{{'记录操作' | dyLanguage}}<span class="caret"></span></a>
                                                        <ul class="dropdown-menu" role="menu" style="text-align: center;">
                                                            <li ng-click="editAttribute(attribute)"><a>{{'编辑选项' | dyLanguage}}</a></li>
                                                            <li ng-click="deleteAttribute(gaugeTopic,attribute)"><a>{{'删除选项' | dyLanguage}}</a></li>
                                                        </ul>
                                                    </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                        <div style="text-align: center;">
                                            <button class="btn btn-danger" ng-click="deleteTopic(gaugeTopic)"><i class="fa fa-times"></i>{{'删除题目' | dyLanguage}}</button>
                                            <button class="btn btn-primary" ng-click="editTopic(gaugeTopic)"><i class="fa fa-edit"></i>{{'编辑题目' | dyLanguage}}</button>
                                            <button class="btn btn-primary" ng-click="addTopicTemp(gaugeTopic)"><i class="fa fa-plus"></i>{{'新增题目（按当前配置）' | dyLanguage}}</button>
                                            <button class="btn btn-primary" ng-click="addAttribute(gaugeTopic)"><i class="fa fa-plus"></i>{{'新增选项' | dyLanguage}}</button>
                                            <button class="btn btn-primary" ng-click="save()"><i class="fa fa-check"></i>{{'保存当前' | dyLanguage}}</button>
                                        </div>
                                    </div>
                                    <div class="panel-footer" style="text-align: right;">
                                        <h3 class="panel-title" style="float: left;"><strong>{{'当前页面的操作' | dyLanguage}}</strong></h3>
                                        <button class="btn btn-info btn-right" ng-click="addTopic()"><i class="fa fa-plus"></i>{{'新增题目' | dyLanguage}}</button>
                                        <js-xls onread="readWB" onerror="error" class="fileinput btn-info" title="上传微帮格式文件"></js-xls>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- END PAGE CONTENT WRAPPER -->
</div>
